﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace LoginIn
{
    public partial class LoginLayer : Form
    {


        public LoginLayer()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
           
        }

        private void pictureBox1_Click(object sender, EventArgs e)
        {

        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {

        }

        private void Stu_ID_TextChanged(object sender, EventArgs e)
        {
           
        }

       

        private void contextMenuStrip1_Opening(object sender, CancelEventArgs e)
        {

        }

        private void pictureBox3_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void label1_Click(object sender, EventArgs e)
        {

        }

        private void pictureBox1_Click_1(object sender, EventArgs e)
        {

        }

        private void textBox1_TextChanged_1(object sender, EventArgs e)
        {

        }

        private void panel1_Paint(object sender, PaintEventArgs e)
        {

        }

        private void LoginIn_Click(object sender, EventArgs e)
        {
            string sname;
            if (Stu_ID.Text.Length != 10)
            {

                MessageBox.Show("请输入正确的学生ID");
            }
            else 
            {
                oleDbDataAdapter1.Fill(dataSet21);
                DataTable temp = new DataTable();
                temp = dataSet21.Tables[0];
                DataRow[] temp1 = temp.Select("Stu_ID ='"+ Stu_ID.Text+"'");
                sname = (string)temp1[0]["Stu_name"];
                Form2 mainmenu = new Form2(sname,Stu_ID.Text);
                this.Hide();
                mainmenu.Show();
            }
        }
    }
}
